from sqlalchemy import Column, Integer, String, DECIMAL, Text, DateTime, Boolean
from sqlalchemy.sql import func
from database import Base

class Furniture(Base):
    """家具模型"""
    __tablename__ = "furniture"
    
    id = Column(Integer, primary_key=True, index=True)
    name = Column(String(100), comment="家具名称")
    price = Column(DECIMAL(10, 2), comment="售价")
    img = Column(String(500), comment="照片URL")
    describe = Column(String(500), comment="描述")
    stock = Column(Integer, default=0, comment="库存")
    ison = Column(Boolean, default=True, comment="是否启用")
    created_at = Column(DateTime, server_default=func.now(), comment="创建时间")
    brand = Column(String(100), comment="品牌")
    description = Column(Text, comment="详细描述")
    category = Column(String(100), comment="类别")
